﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IRC.IRepairClouds.DataLayer
{
    public static class PostprocessExtensions
    {
        public static IEnumerable<T> Postprocess<T>(this IEnumerable<T> source, Action<T> shaper)
        {
            return new PostprocessEnumerable<T>(source, shaper);
        }

        public static IQueryable<T> Postprocess<T>(this IQueryable<T> source, Action<T> shaper)
        {
            return new PostprocessQueryable<T>(source, shaper);
        }

        public static IEnumerable<TRes> Postprocess<T, TRes>(this IEnumerable<T> source, Func<T, TRes> shaper)
        {
            return new PostprocessEnumerable<T, TRes>(source, shaper);
        }

        public static IQueryable<TRes> Postprocess<T, TRes>(this IQueryable<T> source, Func<T, TRes> shaper)
        {
            return new PostprocessQueryable<T, TRes>(source, shaper);
        }
    }
}
